package request

type GetInterfaceListRequest struct {
	ProjectId int `binding:"required" form:"project_id" json:"project_id" label:"所属项目"`
	MenuId    int `binding:"omitempty" form:"menu_id" json:"menu_id" label:"所属分类"`
	Page      int `binding:"required,min=1" form:"page" json:"page" label:"页码"`
	PageSize  int `binding:"required,min=1,max=100" form:"page_size" json:"page_size" label:"每页数"`
}

type DelInterfaceRequest struct {
	InterfaceId int `binding:"required" form:"interface_id" json:"interface_id" label:"接口"`
	ProjectId   int `binding:"required" form:"project_id" json:"project_id" label:"所属项目"`
}

type CreateInterfaceRequest struct {
	Name      string `binding:"required,max=200" form:"name" json:"name" label:"接口名称"`
	ProjectId int    `binding:"required" form:"project_id" json:"project_id" label:"所属项目"`
	MenuId    int    `binding:"required,min=1" form:"menu_id" json:"menu_id" label:"所属分类"`
	Path      string `binding:"required,max=200" form:"path" json:"path" label:"接口地址"`
	Method    int    `binding:"required,min=1,max=4" form:"method" json:"method" label:"请求方法"`
}

type EditInterfaceRequest struct {
	InterfaceId int           `binding:"required" form:"interface_id" json:"interface_id" label:"接口ID"`
	Name        string        `binding:"required,max=200" form:"name" json:"name" label:"接口名称"`
	ProjectId   int           `binding:"required" form:"project_id" json:"project_id" label:"所属项目"`
	MenuId      int           `binding:"required,min=1" form:"menu_id" json:"menu_id" label:"所属分类"`
	Path        string        `binding:"required,max=200" form:"path" json:"path" label:"接口地址"`
	Method      int           `binding:"required,min=1,max=4" form:"method" json:"method" label:"请求方法"`
	Header      []interface{} `binding:"omitempty" form:"header" json:"header" label:"header参数"`
	Query       []interface{} `binding:"omitempty" form:"query" json:"query" label:"query参数"`
	Body        []interface{} `binding:"omitempty" form:"body" json:"body" label:"body参数"`
	Json        []interface{} `binding:"omitempty" form:"json" json:"json" label:"json返回数据"`
}

type GetInterfaceRequest struct {
	InterfaceId int `binding:"required" form:"interface_id" json:"interface_id" label:"接口"`
	ProjectId   int `binding:"required" form:"project_id" json:"project_id" label:"所属项目"`
}
